import 'package:flutter/material.dart';

/// sliding_gradient_transform.dart
///
/// Created by fuchuanwei on Tue Feb 21 2023.
///
/// Description: 微光变换动画
///
class SlidingGradientTransform extends GradientTransform {
  const SlidingGradientTransform({
    required this.slidePercent,
  });

  final double slidePercent;

  @override
  Matrix4? transform(Rect bounds, {TextDirection? textDirection}) {
    return Matrix4.translationValues(bounds.width * slidePercent, 0.0, 0.0);
  }
}
